<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
<h:head>
	<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
    <title>#{requests.editedRequestName}</title>
</h:head>
<h:body>
	<f:facet name="last">
		<h:outputStylesheet name="css/style.css" />
    </f:facet>
	<h:form>
	
		
		<h:panelGrid columns="3">
			<h:outputLabel value="Название :" for="requestName" />
			<p:inputText value="#{requestsBean.editedRequestName}" id="requestName"/>
			<br/>
			<h:outputLabel value="Дата создания :" for="createDate" />
			<p:calendar value="#{requestsBean.editedRequestCreateDate}" id="createDate" />
			<br/>
			<h:outputLabel value="Дата завершения :" for="End date" />
			<p:calendar value="#{requestsBean.editedRequestEndDate}" id="endDate" />
			<br/>
			<h:outputLabel value="Заказчик :" for="customer" />
			<p:selectOneMenu id="customer" value="#{requestsBean.editedRequestCustomer}" label="editedRequestCustomer" style="width:100%" required="false">
				<f:converter converterId="userConverter" />
				<f:selectItems value="#{usersBean.users}" var="users" />
                
            </p:selectOneMenu>
			<br/>
			
			<h:outputLabel value="Поддержка :" for="support" />
			<p:selectOneMenu id="support" value="#{requestsBean.editedRequestSupport}" label="editedRequestSupport" style="width:100%" required="false">
				<f:converter converterId="userConverter" />
				<f:selectItems value="#{usersBean.users}" var="users" />
                
            </p:selectOneMenu>
			<br/>
			
			<h:outputLabel value="Дистрибюьторы :" for="editedDistr" />
			<p:selectOneMenu id="distrs" value="#{requestsBean.editedRequestDistributors}" label="editedDistr" style="width:100%" required="false">
				<f:converter converterId="distrConverter" />
				<f:selectItems value="#{distrsBean.distrs}" var="distrs" />
			</p:selectOneMenu>
			<br/>
			
		</h:panelGrid>
	
		<p:commandButton value="Сохранить и вернуться" action="#{requestsBean.saveAndExit}"/>
		
		<p:commandButton value="Сохранить" action="#{requestsBean.save}"/>
		
		<p:commandButton value="Вернуться" action="#{requestsBean.exit}"/>
		
		<br/><br/>
		
		Комментарии : <br/>
		
		
		<p:inputTextarea cols="150" value="#{requestsBean.newComment}" id="comment" />
		
		<br/>
		
		<p:commandButton value="Добавить комментарий" update="tbl" action="#{requestsBean.addComment}"/>
		
		<br/>
		
		 
		<p:dataTable id="tbl" 
			emptyMessage=""
			styleClass="hide-column-names"
			var="req" 
			value="#{requestsBean.comments}">

	
	        <p:column>
	        	<br/>
	        	<h:outputText value="#{req.commentDate}" />
	        	<br/>
	        	<h:outputText value="#{req.comment}" />
	        	<br/>
	        </p:column>
        
        </p:dataTable>
		
		
	</h:form>
	

</h:body>
</html>